<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type="text/javascript">
		window.onload = function () {
			item = document.getElementsByClassName('item');

			i = 0;

			function run() {
				for (var k = 0; k < item.length; k++) {
					item[k].style.background="#fff";
				}

				item[i].style.background="red";

				i++;

				if(cn==100){
					cn =100;
				}else{
					cn-=100;
				}

				if(start){
					setTimeout(run,cn);
				}
				
				if(i==item.length){
					i=0;
				}
			}
			btn = document.getElementById('btn');

			start = false;

			cn =1000;
			
			btn.onclick = function () {
				if(start==false){
					setTimeout(run,cn);
					start = true;
				}else{
					// clearInterval(time);
					start = false;
				}
			}

			// 标签.onclick = function () {
			// 	// body...
			// }
		}
	</script>
</head>
<body>
	<button id="btn">开始</button>
	<span class="item">学并思</span>
	<span class="item">学并思</span>
	<span class="item">学并思</span>
	<span class="item">学并思</span>
	<span class="item">学并思</span>
	<span class="item">学并思</span>
	<span class="item">学并思</span>
	<span class="item">学并思</span>
	<span class="item">学并思</span>
	<span class="item">学并思</span>
</body>
</html>